#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "uevent.h"

static void _OnFDCallback(int fd, eUEventOperation op, void *arg) {
    char tmp[11] = {0};
    int rsize = read(fd, tmp, 10);
    printf("stdio input --> len:%d, data:[%s]\n", rsize, tmp);
}

int test_fd_install(UEventLoop *loop) {

    UEventFileDescDetail pipe_fd_detail = {kUEventOperationRead, _OnFDCallback, NULL};
    UEvent_UpdateFileDesc(loop, STDIN_FILENO, &pipe_fd_detail);

    return 0;
}
